package com.burt.user.service;

import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.burt.user.domain.UserInfo;
import com.burt.user.repository.UserRepository;

import lombok.extern.slf4j.Slf4j;

/**
 * {@link UserService 用户服务}提供者实现
 * 
 * @author luowei1
 * @date 2018/7/17 10:16
 */
@Slf4j
@Service
public class UserServiceImpl implements UserService {

    private final UserRepository userRepository;

    @Autowired
    public UserServiceImpl(UserRepository userRepository) {
        this.userRepository = userRepository;
    }

    @Override
    public boolean saveUser(UserInfo userInfo) {
        return userRepository.saveUser(userInfo);
    }

    @Override
    public Collection<UserInfo> findAllUser() {
        log.info("获取所有用户数据");
        return userRepository.findAllUser();
    }
}
